package cn.iocoder.an.module.business.dal.mysql.partlist;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.partlist.PartListDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.partlist.vo.*;

/**
 * 零件号 Mapper
 *
 * @author zzy
 */
@Mapper
public interface PartListMapper extends BaseMapperX<PartListDO> {

    default PageResult<PartListDO> selectPage(PartListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PartListDO>()
                .likeIfPresent(PartListDO::getPartNumber, reqVO.getPartNumber())
                .likeIfPresent(PartListDO::getSupplyCode, reqVO.getSupplyCode())
                .likeIfPresent(PartListDO::getSupplyName, reqVO.getSupplyName())
                .eqIfPresent(PartListDO::getPartDes, reqVO.getPartDes())
                .betweenIfPresent(PartListDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PartListDO::getId));
    }

}